<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/19 0019
 * Time: 14:21
 */
namespace app\controllers;
use yii\web\Controller;

class ExampleController extends Controller{
    public function actions(){
        return [
            'greeting'=>'app\components\GreetingAction',
        ];
    }

//    public $defaultAction='HelloWorld';
    public $defaultAction = "hello-world";

    public function actionIndex(){
        $message = "index action of examplecontroller";
        return $this->render("example",['message'=>$message]);
    }

    public function actionHelloWorld(){
        return "hello world";
    }

    public function actionOpenGoogle(){
        return $this->redirect("http://www.baidu.com");
    }

    public function actionTestParams($first,$second){
        echo $first," ",$second;
    }
}